package com.cjj.eatlasflow.exception;

import com.cjj.eatlasflow.common.enums.ErrorCodeEnum;

/**
 * 自定义业务异常类
 */
public class BusinessException extends RuntimeException {
    /**
     *
     */
    private final int code;

    public BusinessException(int code, String message) {
        super(message);
        this.code = code;
    }

    public BusinessException(ErrorCodeEnum errorCodeEnum) {
        super(errorCodeEnum.getMessage());
        this.code = errorCodeEnum.getCode();
    }

    public int getCode() {return this.code;}
}
